package com.cy.sp02.item.service;

import com.cy.pojo.Item;
import com.cy.server.ItemService;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Chenwx
 * @date 2021/4/29 11:43
 */
@Service
@Log4j2
public class ItemServiceImpl implements ItemService {
    @Override
    public List<Item> getItem(String orderId) {
        List<Item> list = new ArrayList<>();
        list.add(new Item(1, "商品1", 1));
        list.add(new Item(2, "商品2", 5));
        list.add(new Item(3, "商品3", 2));
        list.add(new Item(4, "商品4", 1));
        list.add(new Item(5, "商品5", 3));
        return list;
    }
    @Override
    public void decreaseNumber(List<Item> items) {
        for (Item item : items) {
            log.info("减少商品库存："+item);
        }
    }
}
